// 验证用户名：长度不小于5位，且只能为英文
export function validateUsername(username) {
    const usernameRegex = /^[a-zA-Z0-9]{5,}$/;
    return usernameRegex.test(username);
}
// 验证密码：长度不小于5为，且只能为数字和字母
export function validatePassword(password) {
    const passwordRegex = /^[a-zA-Z0-9]{5,}$/;
    return passwordRegex.test(password);
}

// 验证密码是否一致
export function validatePasswordMatch(password, confirmPassword) {
    return password === confirmPassword;
}

// 验证邮箱：符合邮箱格式
export function validateEmail(email) {
    const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
    return emailRegex.test(email);
}